package com.lzcangqiong.design.patterns.factory.simple;

/**
 * 苹果
 * Created by luozhen on 2018/6/13.
 */
public class Apple implements Fruit{

    private int treeAge;

    @Override
    public void grow() {
        log("Apple is growing...");
    }

    @Override
    public void harvest() {
        log("Apple has bean harvested.");
    }

    @Override
    public void plant() {
        log("Apple has bean planted.");
    }

    private void log(String msg) {
        System.out.println(msg);
    }

    /**
     * 获取树龄
     * @return
     */
    public int getTreeAge() {
        return treeAge;
    }

    /**
     * 设置数龄
     * @param treeAge
     */
    public void setTreeAge(int treeAge) {
        this.treeAge = treeAge;
    }
}
